subroutine dwrite(nunit,p,r)
  use param
  implicit none
  integer,intent(in) :: nunit
  integer,intent(inout) :: p
  real(dbl),intent(in) :: r
  p=p+1
  write(unit=nunit,rec=p) r
  return
end subroutine dwrite
